home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / diskutil / ccache.arc / cache.h < prev    next >
C/C++ Source or Header  |  1989-04-05  |  847b  |  40 lines

  1. /*
  2.  * Floppy Disk Cache (Atari ST)
  3.  */
  4.  
  5. #ifndef NULL            /* belong in <stddef.h> */
  6. #define    NULL    0L
  7. typedef    long    size_t;
  8. #endif
  9.  
  10. /* magic functions to return internal tables to cstat */
  11. #define    CSTAT    -1            /* return address of cache tables */
  12. #define    CINIT    -2            /* clear cache */
  13.  
  14. /* cache parameters */
  15. #define    NSECT    (82*2*10)        /* maximum sectors cached */
  16. #define    CYCLE    100            /* update interval */
  17.  
  18. #define    A_INC    16            /* increment for each reference */
  19.  
  20. /* indices for stats array */
  21. #define    TOTAL    0
  22. #define    HITS    1
  23. #define    READS    2
  24. #define    WRITES    3
  25. #define    RECLMS    4
  26. #define    STATS    5            /* elements in stats */
  27.  
  28. #define    NOBUF    (-1)            /* no cached sector */
  29.  
  30. /* per sector cache information */
  31. typedef struct {
  32.     short    avg;        /* average usage */
  33.     short    buf;        /* index of cached sector in cbufs [] */
  34. } Cache;
  35.  
  36. typedef struct {
  37.     char    data [512];
  38. } Sector;
  39.  
  40.